package com.journey.org.ui.knowledge

import android.R.attr.mode
import android.os.Bundle
import com.journey.org.entity.PlayHomeEntity
import com.journey.org.ui.web.WebActivity
import com.mvvmhabit.org.base.MultiItemViewModel
import com.mvvmhabit.org.binding.command.BindingAction
import com.mvvmhabit.org.binding.command.BindingCommand
import java.security.GeneralSecurityException
import javax.crypto.Cipher
import javax.crypto.SecretKey
import javax.crypto.spec.SecretKeySpec


/**
 * @Date: 2020/11/30 10:42
 * @Author:小妖
 * @Description: - 知识-内容
 */
class KnowLedgeBodyViewModel(vm: KnowLedgeViewModel, val entity: PlayHomeEntity) :
    MultiItemViewModel<KnowLedgeViewModel>(vm) {

    val isVisible = "" != entity.envelopePic

    val onClickEnterDetailCommand = BindingCommand<Any>(object : BindingAction {
        override fun call() {
            val bundle = Bundle()
            bundle.putString("loadUrl", entity.link)
            bundle.putString("title", entity.title)
            viewModel.startActivity(WebActivity::class.java, bundle)
        }
    })
}